Register-Lib PowerShell.Sugar -InitDependencies PowerShell.Lang, PSObjects

# Aliases
Set-Alias : Select-Object
Set-Alias :: Select-String
Set-Alias grep Select-String
Set-Alias ih Invoke-history -Option AllScope
Set-Alias ?? Coalesce-Args
Set-Alias '>' Get-PropertyValue
Set-Alias '>>' InvokeOnCurrent

# one-liners from http://blogs.msdn.com/powershell/archive/2006/06/24/645000.aspx
function dir   { get-childitem $args -ea silentlycontinue | sort @{e={$_.PSIsContainer}; asc=$false},@{e={$_.Name}; asc=$true} } 
function dirw  { get-childitem $args -ea silentlycontinue | sort @{e={$_.PSIsContainer}; asc=$false},@{e={$_.Name}; asc=$true} | format-wide } 
function dirs  { get-childitem $args -ea silentlycontinue | sort Length } 
function dirt  { get-childitem $args -ea silentlycontinue | sort LastWriteTime } 
function dird  { get-childitem $args -ea silentlycontinue | where { $_.PSIsContainer } }

if (!(Get-Command 'Get-PropertyValue' -ErrorAction SilentlyContinue)){    
    #Set-Alias Get-PropertyValue InvokeOnCurrent
    Set-Alias Get-PropertyValue Expand-Property  
}